package com.zhoushihao.class0808;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
//        Scanner sc = new Scanner(System.in);
//        String str = sc.nextLine();
//        String[] strArr = str.split(", ");
//        int[] arr = new int[strArr.length];
//        for (int i = 0; i < strArr.length; i++) {
//            arr[i] = Integer.parseInt(strArr[i]);
//        }
        int[] arr = {1,2,3,4,5,6,7,8,9,10};
        int sum = 0;
        double avg = 0;
        double mid = 0;
        Arrays.sort(arr);
        for (int i = 0; i < arr.length; i++) {
            sum+= arr[i];
        }
        avg = sum*1.0/arr.length;
        if(arr.length%2==0){
            mid = (arr[arr.length/2-1]+arr[arr.length/2])*1.0/2;
        }else{
            mid = arr[arr.length/2]*1.0;
        }
        System.out.println(Arrays.toString(arr));
        System.out.println("平均数="+avg);
        System.out.println("中位数="+mid);
    }
}
